{extend name="public/base" /}

{block name="title"}
<title>{:confv('title')}</title>
<meta name="keywords" content="{:confv('keywords')}">
<meta name="description" content="{:confv('description')}">
{/block}

{block name="pjax_container"}
<div class="container">
    <div class="row">
        <div class="col-sm-4" >
            {include file="inc/left" /}
        </div>
        
        <div class="col-sm-8" >
            <div class="side-box bg-white">
                <div class="go-admin">
                    <a href="/admin" target="_blank">点我去后台</a>
                    <p>测试账号：admin</p>
                    <p>测试密码：123456</p>
                    <p>系统更新会第一时间在群通知</p>
                    <p>一些资料也能在群里下载</p>
                </div>
            </div>
            
            <div class="new-arc-container">
                <div class="new-arc-box"></div>
                <button class="btn btn-block btn-success" id="new-arc-btn" data-page="1" 
                data-loading-text="&lt;i class='fa fa-spinner fa-spin '&gt;&lt;/i&gt; 加载中..." >点击加载</button>
            </div>
        </div>
    </div>
</div>

<script>
$(function(){
    $('body').off('click', '#new-arc-btn');
    $('body').on("click", '#new-arc-btn', function(event){
        var _this = $(this);
        var page = _this.data('page');
        _this.button('loading');
        $.ajax({
            type : "get",
            url : "/index/index/newarc/page/"+page,
            success : function(html) {
                if( html != ''){
                    $('.new-arc-box').append(html);
                    _this.data("page", page+1);   //分页数+1
                    _this.button('reset');
                }else{
                    _this.html('没有更多');
                }
            }
        });
    });
    $('#new-arc-btn').trigger("click");
})
</script>
{/block}